#include "Task_led.h"


/* LED0 任务优先级 */
#define LED0_TASK_PRIO 10
/* LED0 任务堆栈大小 */
#define LED0_STK_SIZE 128
/* LED0 任务任务句柄 */
TaskHandle_t LED0Task_Handler;
/* LED0 任务入口函数 */
void LED0_task(void *pvParameters);


/* LED1 任务优先级 */
#define LED1_TASK_PRIO 9
/* LED1 任务堆栈大小 */
#define LED1_STK_SIZE 128
/* LED1 任务任务句柄 */
TaskHandle_t LED1Task_Handler;
/* LED1 任务入口函数 */
void LED1_task(void *pvParameters);


void task_LED_Create(void)
{
	//创建LED0任务
    xTaskCreate((TaskFunction_t )LED0_task,
                (const char*    )"LED0_task",
                (uint16_t       )LED0_STK_SIZE,
                (void*          )NULL,
                (UBaseType_t    )LED0_TASK_PRIO,
                (TaskHandle_t*  )&LED0Task_Handler);
    //创建LED1任务
    xTaskCreate((TaskFunction_t )LED1_task,     
                (const char*    )"LED1_task",   
                (uint16_t       )LED1_STK_SIZE,
                (void*          )NULL,
                (UBaseType_t    )LED1_TASK_PRIO,
                (TaskHandle_t*  )&LED1Task_Handler);
}


/* LED0 任务函数 */
void LED0_task(void *pvParameters)
{
	

	while(1)
	{
		//at32_led_toggle(LED3);
		//printf("LED3 Toggle\r\n");

		vTaskDelay(1000);
	}
}

uint8_t debug1,debugVM0,debugVM1,debugHOS,debugDMM,debug_nn;
uint8_t debugDMAL = 0X86, debugDMAH = 0X85, debugCMAL = 0X8A , debugCMAH = 0X89;
int defsdfg;
uint8_t debug6_buf[]={0xAA,0x01,0x00,0x00,0x00,0x00,0xAB};
CHAR_ATTRIB debugbuf;
extern int changeSymbol(int num);
/* LED1 开始任务 */
void LED1_task(void *pvParameters)
{
	//Uart6Send(debug6_buf,7);
	
	while(1)
	{
//		debug1 = read_at7456_addr_data(VM0);
//		debugVM0 = read_at7456_addr_data(0X80);
//		debugVM1 = read_at7456_addr_data(0X81);
//		debugHOS = read_at7456_addr_data(0X82);
//		debugDMM = read_at7456_addr_data(0X84);
//		
//		debugDMAL = read_at7456_addr_data(0X80);
//		debugDMAH = read_at7456_addr_data(0X81);
//		debugCMAL = read_at7456_addr_data(0X82);
//		debugCMAH = read_at7456_addr_data(0X84);
		
		//at7456E_read_char(1, 3, &debugbuf);
//			defsdfg = changeSymbol(100);
//			debugVM0 = My_read_at7456_addr_data(0X80,0x00);
//			debugDMAL = My_read_at7456_addr_data(0Xa1,0x00);
//			debugDMAH = My_read_at7456_addr_data(0Xa0,0x00);
//			debugVM1 = My_read_at7456_addr_data(0X83,0x00);
		
		//Uart3Send(IR_BT656_PAL2_Cmd,MyStrlen(IR_BT656_PAL2_Cmd));
		
		  // AT7456复位
//	debug_nn = read_at7456_addr_data(0XA0);
//	if((debug_nn&0x40) != 0X40)
//	{
//		delay_ms(200);	
//		write_at7456_addr_data(VM0, 0x40|0X08);
//	}
//	delay_ms(5);	
	//write_at7456_addr_data(VM0, NTSC|n);  
	//write_at7456_addr_data(VM0, PAL|n); 
	//write_at7456_addr_data(VM0, 0x40|0X08); 
		
		//ConfigMenu_IR_OsdShowON();
//		Uart3Send(IR_ZOOM_Cmd,MyStrlen(IR_ZOOM_Cmd));

			vTaskDelay(500);
//		vTaskDelay(1000);
	}
}




